#pragma once

#include <pdh.h>
#pragma comment(lib, "pdh.lib")

class CPUMeasure
{
public:
	CPUMeasure(void);
	~CPUMeasure(void);
	void Initialize();
	void Shutdown();
	void Frame();
	int GetCpuPercentage();
private:
	bool m_canReadCpu;
	HQUERY m_queryHandle;
	HCOUNTER m_counterHandle;
	unsigned long m_lastSampleTime;
	long m_cpuUsage;
};
